{% extends "base.html" %}
{% block title %}| Registro{% endblock %}

{% include "Header.html" %}

{% block body %}
{% if user.auth.username %}
	<table class=sortable align="center">
		<tr> <th> <h2>Usuario {{ user.auth.username }} cadastrado ! Em alguns minutos ele estara no Ranking. </h2><br/>
		<h3>Voce ja pode logar utilizando o botao "Login" acima. </h3><br/><br/>
		<i>Obs.: A posicao do rank so e calculada uma vez ao dia, entao novos usuarios estarao separados do rank.</i><br />
		</th></tr>
	</table>
{% else %}

<form action="." method="POST">{% csrf_token %}
<table align="center">
	<tr>
		<td class="textocomum">
        	<label for="id_username">Username (PSN_ID):</label>
		</td>
		<td>
        		{{ form.username }}
        		{{ form.username.errors }}
		</td>
	</tr>
	<tr>
		<td></td>
	</tr>
	<tr>
		<td class="textocomum">
        	<label for="id_first_name">Nome :</label>
		</td>
		<td>
        		{{ form.first_name }}
        		{{ form.first_name.errors }}
		</td>
	</tr>
	<tr>
		<td></td>
	</tr>
	<tr>
		<td class="textocomum">
        	<label for="id_last_name">Sobrenome :</label>
		</td>
		<td>
        		{{ form.last_name }}
        		{{ form.last_name.errors }}
		</td>
	</tr>
	<tr>
		<td></td>
	</tr>
	<tr>
		<td class="textocomum">
        	<label for="id_password1">Senha :</label>
		</td>
		<td>
        		{{ form.password1 }}
        		{{ form.password1.errors }}
		</td>
	</tr>
	<tr>
		<td></td>
	</tr>
	<tr>
		<td class="textocomum">
        	<label for="id_password2">Confirmar senha :</label>
		</td>
		<td>
        		{{ form.password2 }}
        		{{ form.password2.errors }}
		</td>
	</tr>
	<tr>
		<td></td>
	</tr>
	<tr>
		<td class="textocomum">
        	<label for="id_email">Email:</label>
		</td>
		<td>
        		{{ form.email }}
        		{{ form.email.errors }}
		</td>
	</tr>
	<tr>
		<td></td>
	</tr>
	<tr>
		<td class="textocomum">
        	<label for="id_birth">Email:</label>
			Aniversario (dd/mm/aaaa):
		</td>
		<td>
        		{{ form.birth }}
        		{{ form.birth.errors }}
		</td>
	</tr>
	<tr>
		<td></td>
	</tr>
</table>

<div align="center">
	<input type="submit" id="confirm_button" value="Confirmar" />
	<input type="button" id="clean_button" value="Limpar" onClick="javascript:cleanAll()" />
	<input type="hidden" name="next" value="/rank" />
</div>
</form>

{% endif %}

{% endblock %}
